package dmmm.shemes;


import java.awt.Point;
import java.util.ArrayList;

import dmmm.components.*;
import dmmm.gui.GuiLine;
import dmmm.gui.GuiScheme;

public class Exec3 {

    private static OR NZOR1;
    private static AND NAND1;
    private static NOT ZNOT0;
    private static NOT ZNOT1;
    private static NOT ZNOT2;
    private static NOT ZNOT3;
    private static NOT ZNOT4;
    private static NOT ZNOT5;
    private static NOT ZNOT6;
    private static NOT ZNOT7;
    private static AND ZAND1;
    private static AND ZAND2;
    private static OR COR1, COR2, COR3, COR4, COR5;
    private static AND CAND1, CAND2, CAND3, CAND4;
    private static NOT CNOT1;
    private static NOT VNOT1, VNOT2, VNOT3, VNOT4, VNOT5, VNOT6, VNOT7, VNOT8;
    private static AND VAND1, VAND2, VAND3, VAND4, VAND5, VAND6, VAND7, VAND8, VAND9, VAND10;
    private static OR VOR1, VOR2, VOR3;
    private static GuiScheme gui;

    public static GuiScheme getGui() {
        return gui;
    }

    public static void init() {

        NZOR1 = new OR(18);
        NAND1 = new AND();
        ZNOT0 = new NOT();
        ZNOT1 = new NOT();
        ZNOT2 = new NOT();
        ZNOT3 = new NOT();
        ZNOT4 = new NOT();
        ZNOT5 = new NOT();
        ZNOT6 = new NOT();
        ZNOT7 = new NOT();
        ZAND1 = new AND(8);
        ZAND2 = new AND();

        CAND1 = new AND();
        CAND2 = new AND();
        CAND3 = new AND();
        CAND4 = new AND();
        CNOT1 = new NOT();
        COR1 = new OR();
        COR2 = new OR();
        COR3 = new OR(4);
        COR4 = new OR(4);
        COR5 = new OR(4);

        VNOT1 = new NOT();
        VNOT2 = new NOT();
        VNOT3 = new NOT();
        VNOT4 = new NOT();
        VNOT5 = new NOT();
        VNOT6 = new NOT();
        VNOT7 = new NOT();
        VNOT8 = new NOT();
        VAND1 = new AND(3);
        VAND2 = new AND(3);
        VAND3 = new AND();
        VAND4 = new AND(3);
        VAND5 = new AND(3);
        VAND6 = new AND();
        VAND7 = new AND();
        VAND8 = new AND();
        VAND9 = new AND();
        VAND10 = new AND();
        VOR1 = new OR();
        VOR2 = new OR();
        VOR3 = new OR(4);


    }

    public static void connect() {

        NZOR1.setInputPin(0, Fetch2.LDB());
        NZOR1.setInputPin(1, Fetch2.POPB());
        NZOR1.setInputPin(2, Fetch2.ADD());
        NZOR1.setInputPin(3, Fetch2.SUB());
        NZOR1.setInputPin(4, Fetch2.INC());
        NZOR1.setInputPin(5, Fetch2.DEC());
        NZOR1.setInputPin(6, Fetch2.AND());
        NZOR1.setInputPin(7, Fetch2.OR());
        NZOR1.setInputPin(8, Fetch2.XOR());
        NZOR1.setInputPin(9, Fetch2.NOT());
        NZOR1.setInputPin(10, Fetch2.ASR());
        NZOR1.setInputPin(11, Fetch2.LSR());
        NZOR1.setInputPin(12, Fetch2.ROR());
        NZOR1.setInputPin(13, Fetch2.RORC());
        NZOR1.setInputPin(14, Fetch2.ASL());
        NZOR1.setInputPin(15, Fetch2.LSL());
        NZOR1.setInputPin(16, Fetch2.ROL());
        NZOR1.setInputPin(17, Fetch2.ROLC());

        NAND1.setInputPin(0, Exec1.AB7());
        NAND1.setInputPin(1, NZOR1.getOut(0));

        ZNOT0.setInputPin(0, Exec1.AB0());
        ZNOT1.setInputPin(0, Exec1.AB1());
        ZNOT2.setInputPin(0, Exec1.AB2());
        ZNOT3.setInputPin(0, Exec1.AB3());
        ZNOT4.setInputPin(0, Exec1.AB4());
        ZNOT5.setInputPin(0, Exec1.AB5());
        ZNOT6.setInputPin(0, Exec1.AB6());
        ZNOT7.setInputPin(0, Exec1.AB7());

        ZAND1.setInputPin(0, ZNOT0.getOut(0));
        ZAND1.setInputPin(1, ZNOT1.getOut(0));
        ZAND1.setInputPin(2, ZNOT2.getOut(0));
        ZAND1.setInputPin(3, ZNOT3.getOut(0));
        ZAND1.setInputPin(4, ZNOT4.getOut(0));
        ZAND1.setInputPin(5, ZNOT5.getOut(0));
        ZAND1.setInputPin(6, ZNOT6.getOut(0));
        ZAND1.setInputPin(7, ZNOT7.getOut(0));

        ZAND2.setInputPin(0, NZOR1.getOut(0));
        ZAND2.setInputPin(1, ZAND1.getOut(0));



        COR1.setInputPin(0, Fetch2.ADD());
        COR1.setInputPin(1, Fetch2.INC());
        COR2.setInputPin(0, Fetch2.SUB());
        COR2.setInputPin(1, Fetch2.DEC());

        CAND1.setInputPin(0, COR1.getOut(0));
        CAND1.setInputPin(1, Exec1.C8());

        CNOT1.setInputPin(0, Exec1.C8());
        CAND2.setInputPin(0, COR2.getOut(0));
        CAND2.setInputPin(1, CNOT1.getOut(0));

        COR3.setInputPin(0, Fetch2.ASR());
        COR3.setInputPin(1, Fetch2.LSR());
        COR3.setInputPin(2, Fetch2.ROR());
        COR3.setInputPin(3, Fetch2.RORC());

        CAND3.setInputPin(0, COR3.getOut(0));
        CAND3.setInputPin(1, Exec1.AB0());

        COR4.setInputPin(0, Fetch2.ASL());
        COR4.setInputPin(1, Fetch2.LSL());
        COR4.setInputPin(2, Fetch2.ROL());
        COR4.setInputPin(3, Fetch2.ROLC());

        CAND4.setInputPin(0, COR4.getOut(0));
        CAND4.setInputPin(1, Exec1.AB7());

        COR5.setInputPin(0, CAND1.getOut(0));
        COR5.setInputPin(1, CAND2.getOut(0));
        COR5.setInputPin(2, CAND3.getOut(0));
        COR5.setInputPin(3, CAND4.getOut(0));




        VNOT1.setInputPin(0, Exec1.AB7());
        VNOT2.setInputPin(0, Exec1.BB7());
        VNOT3.setInputPin(0, Exec1.ALU7());
        VAND1.setInputPin(0, VNOT1.getOut(0));
        VAND1.setInputPin(1, VNOT2.getOut(0));
        VAND1.setInputPin(2, Exec1.ALU7());
        VAND2.setInputPin(0, Exec1.AB7());
        VAND2.setInputPin(1, Exec1.BB7());
        VAND2.setInputPin(2, VNOT3.getOut(0));
        VOR1.setInputPin(0, VAND1.getOut(0));
        VOR1.setInputPin(1, VAND2.getOut(0));
        VAND3.setInputPin(0, Fetch2.ADD());
        VAND3.setInputPin(1, VOR1.getOut(0));

        VNOT4.setInputPin(0, Exec1.AB7());
        VNOT5.setInputPin(0, Exec1.BB7());
        VNOT6.setInputPin(0, Exec1.ALU7());
        VAND4.setInputPin(0, VNOT4.getOut(0));
        VAND4.setInputPin(1, Exec1.BB7());
        VAND4.setInputPin(2, Exec1.ALU7());
        VAND5.setInputPin(0, Exec1.AB7());
        VAND5.setInputPin(1, VNOT5.getOut(0));
        VAND5.setInputPin(2, VNOT6.getOut(0));
        VOR2.setInputPin(0, VAND4.getOut(0));
        VOR2.setInputPin(1, VAND5.getOut(0));
        VAND6.setInputPin(0, Fetch2.SUB());
        VAND6.setInputPin(1, VOR2.getOut(0));

        VNOT7.setInputPin(0, Exec1.AB7());
        VAND7.setInputPin(0, VNOT7.getOut(0));
        VAND7.setInputPin(1, Exec1.ALU7());
        VAND8.setInputPin(0, Fetch2.INC());
        VAND8.setInputPin(1, VAND7.getOut(0));

        VNOT8.setInputPin(0, Exec1.ALU7());
        VAND9.setInputPin(0, Exec1.AB7());
        VAND9.setInputPin(1, VNOT8.getOut(0));
        VAND10.setInputPin(0, Fetch2.DEC());
        VAND10.setInputPin(1, VAND9.getOut(0));

        VOR3.setInputPin(0, VAND3.getOut(0));
        VOR3.setInputPin(1, VAND6.getOut(0));
        VOR3.setInputPin(2, VAND8.getOut(0));
        VOR3.setInputPin(3, VAND10.getOut(0));

    }

    public static void gui() {
        GuiLine line; // Pomocna promenljiva
        gui = new GuiScheme("dmmm/dmmm/images/Exec3.png");

        ArrayList<ArrayList<Point>> sections;
        ArrayList<Point> points;


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 89));
        points.add(new Point(182, 89));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 119));
        points.add(new Point(144, 119));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LDB());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 134));
        points.add(new Point(144, 134));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.POPB());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 149));
        points.add(new Point(144, 149));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ADD());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 165));
        points.add(new Point(144, 165));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.SUB());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 180));
        points.add(new Point(144, 180));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.INC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 195));
        points.add(new Point(144, 195));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.DEC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 210));
        points.add(new Point(144, 210));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.AND());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 225));
        points.add(new Point(144, 225));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.OR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 240));
        points.add(new Point(145, 240));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.XOR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 255));
        points.add(new Point(145, 255));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.NOT());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 270));
        points.add(new Point(144, 270));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ASR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 286));
        points.add(new Point(144, 286));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LSR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 301));
        points.add(new Point(144, 301));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 316));
        points.add(new Point(144, 316));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.RORC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 331));
        points.add(new Point(144, 331));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ASL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 346));
        points.add(new Point(144, 346));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LSL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 361));
        points.add(new Point(144, 361));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 376));
        points.add(new Point(144, 376));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROLC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 407));
        points.add(new Point(139, 407));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 422));
        points.add(new Point(140, 422));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB6());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 437));
        points.add(new Point(140, 437));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB5());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 452));
        points.add(new Point(140, 452));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB4());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 467));
        points.add(new Point(140, 467));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB3());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 482));
        points.add(new Point(140, 482));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB2());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 497));
        points.add(new Point(140, 497));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB1());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(129, 512));
        points.add(new Point(140, 512));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB0());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(166, 248));
        points.add(new Point(174, 248));
        points.add(new Point(174, 97));
        points.add(new Point(182, 97));
        sections.add(points);
        line = new GuiLine(sections, NZOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(204, 93));
        points.add(new Point(212, 93));
        sections.add(points);
        line = new GuiLine(sections, NAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(174, 248));
        points.add(new Point(174, 452));
        points.add(new Point(182, 452));
        sections.add(points);
        line = new GuiLine(sections, NZOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(167, 460));
        points.add(new Point(182, 460));
        sections.add(points);
        line = new GuiLine(sections, ZAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(204, 456));
        points.add(new Point(212, 456));
        sections.add(points);
        line = new GuiLine(sections, ZAND2.getOut(0));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 57));
        points.add(new Point(305, 57));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ADD());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 68));
        points.add(new Point(305, 68));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.INC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 87));
        points.add(new Point(305, 87));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.SUB());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 98));
        points.add(new Point(305, 98));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.DEC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 115));
        points.add(new Point(333, 115));
        points.add(new Point(333, 74));
        points.add(new Point(341, 74));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(333, 104));
        points.add(new Point(336, 104));
        sections.add(points);
        line = new GuiLine(sections, Exec1.C8());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(325, 62));
        points.add(new Point(341, 62));
        sections.add(points);
        line = new GuiLine(sections, COR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(325, 93));
        points.add(new Point(340, 93));
        sections.add(points);
        line = new GuiLine(sections, COR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(363, 68));
        points.add(new Point(378, 68));
        points.add(new Point(378, 117));
        points.add(new Point(386, 117));
        sections.add(points);
        line = new GuiLine(sections, CAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(363, 98));
        points.add(new Point(371, 98));
        points.add(new Point(371, 125));
        points.add(new Point(388, 125));
        sections.add(points);
        line = new GuiLine(sections, CAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 132));
        points.add(new Point(303, 132));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ASR());
        gui.addLine(line);
        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 148));
        points.add(new Point(304, 148));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LSR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 163));
        points.add(new Point(304, 163));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROR());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 178));
        points.add(new Point(303, 178));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.RORC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(325, 155));
        points.add(new Point(341, 155));
        sections.add(points);
        line = new GuiLine(sections, COR3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 193));
        points.add(new Point(333, 193));
        points.add(new Point(333, 163));
        points.add(new Point(341, 163));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB0());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(363, 159));
        points.add(new Point(371, 159));
        points.add(new Point(371, 132));
        points.add(new Point(388, 132));
        sections.add(points);
        line = new GuiLine(sections, CAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 208));
        points.add(new Point(303, 208));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ASL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 223));
        points.add(new Point(304, 223));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.LSL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 238));
        points.add(new Point(304, 238));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROL());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 253));
        points.add(new Point(303, 253));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ROLC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(325, 231));
        points.add(new Point(341, 231));
        sections.add(points);
        line = new GuiLine(sections, COR4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(295, 269));
        points.add(new Point(333, 269));
        points.add(new Point(333, 238));
        points.add(new Point(341, 238));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(363, 235));
        points.add(new Point(378, 235));
        points.add(new Point(378, 140));
        points.add(new Point(386, 140));
        sections.add(points);
        line = new GuiLine(sections, CAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(408, 129));
        points.add(new Point(416, 129));
        sections.add(points);
        line = new GuiLine(sections, COR5.getOut(0));
        gui.addLine(line);


        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 269));
        points.add(new Point(458, 269));
        points.add(new Point(458, 529));
        points.add(new Point(473, 529));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(458, 488));
        points.add(new Point(469, 488));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(458, 443));
        points.add(new Point(473, 443));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(458, 412));
        points.add(new Point(469, 412));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(458, 367));
        points.add(new Point(473, 367));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(458, 337));
        points.add(new Point(469, 337));
        sections.add(points);
        line = new GuiLine(sections, Exec1.AB7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 284));
        points.add(new Point(443, 284));
        points.add(new Point(443, 450));
        points.add(new Point(469, 450));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(443, 420));
        points.add(new Point(473, 420));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(443, 374));
        points.add(new Point(473, 374));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(443, 344));
        points.add(new Point(469, 344));
        sections.add(points);
        line = new GuiLine(sections, Exec1.BB7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 299));
        points.add(new Point(427, 299));
        points.add(new Point(427, 537));
        points.add(new Point(469, 537));
        sections.add(points);
        line = new GuiLine(sections, Exec1.ALU7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(427, 352));
        points.add(new Point(473, 352));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(427, 382));
        points.add(new Point(469, 382));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(427, 427));
        points.add(new Point(473, 427));
        sections.add(points);
        points = new ArrayList<Point>();
        points.add(new Point(427, 495));
        points.add(new Point(473, 495));
        sections.add(points);
        line = new GuiLine(sections, Exec1.ALU7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 322));
        points.add(new Point(548, 322));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.ADD());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 344));
        points.add(new Point(503, 344));
        points.add(new Point(503, 356));
        points.add(new Point(513, 356));
        sections.add(points);
        line = new GuiLine(sections, VAND1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 374));
        points.add(new Point(503, 374));
        points.add(new Point(503, 363));
        points.add(new Point(513, 363));
        sections.add(points);
        line = new GuiLine(sections, VAND2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(533, 361));
        points.add(new Point(541, 361));
        points.add(new Point(541, 329));
        points.add(new Point(548, 329));
        sections.add(points);
        line = new GuiLine(sections, VOR1.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(571, 325));
        points.add(new Point(586, 325));
        points.add(new Point(586, 427));
        points.add(new Point(594, 427));
        sections.add(points);
        line = new GuiLine(sections, VAND3.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 397));
        points.add(new Point(548, 397));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.SUB());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 420));
        points.add(new Point(503, 420));
        points.add(new Point(503, 431));
        points.add(new Point(513, 431));
        sections.add(points);
        line = new GuiLine(sections, VAND4.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 450));
        points.add(new Point(503, 450));
        points.add(new Point(503, 439));
        points.add(new Point(513, 439));
        sections.add(points);
        line = new GuiLine(sections, VAND5.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(533, 437));
        points.add(new Point(541, 437));
        points.add(new Point(541, 405));
        points.add(new Point(548, 405));
        sections.add(points);
        line = new GuiLine(sections, VOR2.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(571, 401));
        points.add(new Point(579, 401));
        points.add(new Point(579, 435));
        points.add(new Point(596, 435));
        sections.add(points);
        line = new GuiLine(sections, VAND6.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 473));
        points.add(new Point(548, 473));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.INC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(427, 458));
        points.add(new Point(469, 458));
        sections.add(points);
        line = new GuiLine(sections, Exec1.ALU7());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 492));
        points.add(new Point(541, 492));
        points.add(new Point(541, 480));
        points.add(new Point(548, 480));
        sections.add(points);
        line = new GuiLine(sections, VAND7.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(571, 476));
        points.add(new Point(579, 476));
        points.add(new Point(579, 443));
        points.add(new Point(596, 443));
        sections.add(points);
        line = new GuiLine(sections, VAND8.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(420, 514));
        points.add(new Point(548, 514));
        sections.add(points);
        line = new GuiLine(sections, Fetch2.DEC());
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(496, 533));
        points.add(new Point(541, 533));
        points.add(new Point(541, 522));
        points.add(new Point(548, 522));
        sections.add(points);
        line = new GuiLine(sections, VAND9.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(571, 518));
        points.add(new Point(586, 518));
        points.add(new Point(586, 450));
        points.add(new Point(594, 450));
        sections.add(points);
        line = new GuiLine(sections, VAND10.getOut(0));
        gui.addLine(line);

        sections = new ArrayList<ArrayList<Point>>();
        points = new ArrayList<Point>();
        points.add(new Point(616, 439));
        points.add(new Point(624, 439));
        sections.add(points);
        line = new GuiLine(sections, VOR3.getOut(0));
        gui.addLine(line);

    }

    public static Pin N() {
        return NAND1.getOut(0);
    }

    public static Pin Z() {
        return ZAND2.getOut(0);
    }

    public static Pin C() {
        return COR5.getOut(0);
    }

    public static Pin V() {
        return VOR3.getOut(0);
    }
}
